#include "MTIfStatement.hpp"
#include "MTExpression.hpp"
#include "MTBlock.hpp"
#include <iostream>
#include <sstream>
#include <string>

namespace MathematicaTranslator
{
 	std::string* MTIfStatement::generateCode(CodeGenContext& context)
	{
		std::ostringstream ss;
		ss << "if (";
		ss << *conditions.generateCode(context);
		ss << ") {\n   ";
		ss << *trueStatements.generateCode(context);
		ss << "} else {\n   ";
		ss << *falseStatements.generateCode(context);
		ss << "}";

		return new std::string(ss.str());
	}

}
